package writtenexamination.haisi;

import java.util.ArrayList;

/**
 * @author cyt
 * @create 2020-10-18 11:00
 */
public class Ta {
    public static void main(String[] args) {
        Node node = new Node(2);
        Node node1 = new Node(7);
        Node node2 = new Node(4);
        Node node3 = new Node(3);
        Node node4 = new Node(5);
        node.next = node1;
        node1.next = node2;
        node2.next = node3;
        node3.next = node4;
//        int[] ints = new Ta().nextLargerNodes(node);
//        for (int anInt : ints) {
//            System.out.println(anInt);
//        }
        Ta ta = new Ta();

        ta.breakFor();
    }

    public void breakFor() {
        labelB:
        for (int i = 0; i < 10; i++) {
            for (int j = 0; j < 29; j++) {
                if (j == 6) {
                    System.out.println(j);
                    break labelB;
                } else {
                    System.out.println("test");
                }
            }
        }
    }

    public int[] nextLargerNodes(Node head) {
        ArrayList<Integer> ans = new ArrayList<Integer>();
        while (head != null) {
            ans.add(head.val);
            head = head.next;
        }
        int[] res = new int[ans.size()];
        for (int i = 0; i < ans.size(); i++) {
            Integer cnt = ans.get(i);
            boolean is = true;
            for (int j = i + 1; j < ans.size(); j++) {
                if (ans.get(j) > cnt) {
                    res[i] = ans.get(j);
                    is = false;
                    break;
                }
            }
            if (is) {
                res[i] = 0;
            }
        }
        return res;
    }
}

class Node {
    int val;
    Node next;

    Node(int x) {
        val = x;
    }
}
